<!DOCTYPE html>
<html>
<head>
    <#assign dicSelect=JspTaglibs["http://www.casic304.cn/dicSelect"] />
    <#assign secSelect=JspTaglibs["http://www.casic304.cn/secSelect"] />
    <#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />

    <meta charset="utf-8">
    <title>不合格品审理基本信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
    <#if isClose == 'true'>
    <style>
        body.listBody{background: #fff}
        .listBody .qbdms-bodyDiv{padding: 0 }
        body.qbdms-particulars .qbdms-bodyDiv div.layui-table-view-body{padding: 16px}
        .layui-form-select .layui-input {padding-right: 0;}
    </style>
</#if>
</head>

<body class="listBody qbdms-particulars">
<div class="qbdms-bodyDiv">
    <div class="layui-table-view-body qbdms-add-view-body">
        <#if isClose != 'true'><div class="qbdms-formTitle">不合格品审理<i class="qbdms-returnOn closeWindow">返回</i></div></#if>
    <form class="layui-form" requrl="${ctx}/qbdms/wQbdUnderqualiTrial/get" lay-filter="wQbdUnderqualiTrialDataForm">
        <div class="" style="width: 100%;overflow-x: auto">
            <table class="tableExcel qbdms-zeroTable" width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr id="tbxx"></tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">密级<span style="color: red;">*</span></td>
                    <td ><@secSelect.sec_select data_src=1 required=true name="secret"/></td>
                    <td class="qbdms-zeroTable-lable">编号<span style="color: red;">*</span></td>
                    <td name="registernum"></td>
                    <td class="qbdms-zeroTable-lable">型号<span style="color: red;">*</span></td>
                    <td name="model"></td>
                </tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">产品名称<span style="color: red;">*</span></td>
                    <td name="productname"></td>
                    <td class="qbdms-zeroTable-lable">产品代号<span style="color: red;">*</span></td>
                    <td name="productsymbol"></td>
                    <td class="qbdms-zeroTable-lable">产品编号<span style="color: red;">*</span></td>
                    <td name="productnum"></td>
                </tr>

                <tr>
                    <td class="qbdms-zeroTable-lable">总数量<span style="color: red;">*</span></td>
                    <td name="totalnum"></td>
                    <td class="qbdms-zeroTable-lable">不合格数量<span style="color: red;">*</span></td>
                    <td name="unqualifiednum"></td>
                    <td class="qbdms-zeroTable-lable">责任单位<span style="color: red;">*</span></td>
                    <td name="dutydeptname"></td>
                </tr>

                <tr>
                    <td class="qbdms-zeroTable-lable">产品类别<span style="color: red;">*</span></td>
                    <td name="productcategory"></td>
                    <td class="qbdms-zeroTable-lable">审理级别</td>
                    <td name="triallevel"></td>
                    <td class="qbdms-zeroTable-lable">审理结论</td>
                    <td name="trialresult"></td>
                </tr>

                <tr>
                    <td class="qbdms-zeroTable-lable">参与审理人员</td>
                    <td name="trialpeople"></td>
                    <td class="qbdms-zeroTable-lable">不合格情况描述<span style="color: red;">*</span></td>
                    <td name="underqualidescribe" colspan="3"></td>
                </tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">流程状态<span style="color: red;">*</span></td>
                    <td name="status"></td>
                    <td class="qbdms-zeroTable-lable">审理时间<span style="color: red;">*</span></td>
                    <td name="trialtime"></td>
                </tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">返工情况描述</td>
                    <td colspan="5" name="reworkinfo"></td>
                </tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">责任人</td>
                    <td name="dutyperson"></td>
                    <td class="qbdms-zeroTable-lable">检验员</td>
                    <td name="inspector"></td>
                </tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">返工结果验证</td>
                    <td colspan="5" name="reworkresultvarify"></td>
                </tr>
                <tr>
                    <td class="qbdms-zeroTable-lable">
                        不合格品审理单
                    </td>
                    <td colspan="5">
                        <div class="uploadFileList" fileUploadName="triallist"></div>
                    </td>
                </tr>
                </tbody>
            </table>
            <input type="hidden" name="id" placeholder="请输入"
                   autocomplete="off" class="layui-input  textInput"
                   maxlength="50" fieldname="id">
            <input name="trialtime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
            <input name="createTime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
            <input name="updateTime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
        </div>

        <#if isClose != 'true'>
        <div class="layui-form-item btnformItem">
            <p>
                <button type="reset" id="closeWindow" class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">返回</button>
            </p>
        </div>
        </#if>

        </form>
    </div>
</div>
</div>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>

<script>

    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','setter', 'propsHandle', 'laydate', 'jquery','commonDialog', 'common','publicMethods','qbdmsForm'], function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var common = layui.common;
        var publicMethods = layui.publicMethods;
        var propsHandle = layui.propsHandle;
        var dateTimeFiledLen = $(".dateTimeFiled");

        for (var i = 0; i < dateTimeFiledLen.length; i++) {
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                , type: 'date'
                , trigger: 'click'
            });
        }
        var defProps = {
                //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
                viewMould: 'moulds/', // 组件模块 存放文件 *****
                initCss: [
                    // 'style/forms/grid/grid1',
                    // 'style/forms/grid/grid2',
                    // 'style/forms/grid/grid3',
                    // 'style/forms/template/tag',
                    // 'style/forms/template/text',
                    // 'style/forms/template/table',
                    // 'style/forms/template/textArea',
                    // 'style/forms/template/radioOption',
                    // 'style/forms/template/date',
                    // 'style/forms/template/button',
                    // 'style/forms/template/uploadFile',
                    // 'style/forms/template/richText',
                    // 'style/forms/template/select',
                    // 'style/forms/template/checkOption',
                    // 'style/forms/template/dataLexi',
                    // 'style/forms/template/uploadImg',
                    // 'style/forms/template/selector',
                    // 'style/forms/formDevise',
                    // 'style/forms/dragLay',
                    // 'style/forms/formPreview'
                ],// formAreaInfo:'.formPreview',
                formAreaInfo: 'html',
                temDate: '.temDate',
                uploadFileBtn: '.uploadFileBtn',
                uploadImgBtn: '.uploadImgBtn',
                richTextArea: '.richTextArea',
                selectInput: '.selectInput',
                radioOptionCont: '.radioOptionCont',
                dataLexiTree: '.dataLexiTree',
                selectorBtn: '.selectorBtn'
            },
            temQuery = new propsHandle()  // 实例化模板功能部分
        ;


        // 初始化模板功能
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });
        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href = serverPath.qbdmsPath  + '/qbdms/wQbdUnderqualiTrial/view/list';
        });

        var runId = "${runId}";
        if (runId == null || runId == '') {
            $("#hideAndShow").show();
        }

        var index = parent.layer.getFrameIndex(window.name);
        common.updateForm({
            name: 'wQbdUnderqualiTrialDataForm',
            idValue: "${id}",
            primary: "id",
            getCallback: function (data) {
                $("#tbxx").html("<td class='qbdms-zeroTable-lable'>填报信息:</td><td colspan='5' class=''>【" + data.data.filldept + " | " + data.data.fillman + " | " + data.data.filldate + "】</td>");

                // $("#tbxx").html("<span class='qbdms-TBinformation'>填报信息:</span><span class='qbdms-TBinformationText'>【" + data.data.filldept + " | " + data.data.fillman + " | " + data.data.filldate + "】</span>");
                $("input[name='trialpeople']").attr("ids", data.data.trialpeopleid);
                $("input[name='dutyperson']").attr("ids", data.data.dutypersonid);
                $("input[name='inspector']").attr("ids", data.data.inspectorid);

                //-修改页面 初始化附件组件 开始 ------------------------------------------
                $('.uploadFileList').each(function () {
                    var fileUploadName = $(this).attr("fileUploadName");
                    var jsonFile = data.data[fileUploadName];
                    var files = eval(jsonFile);

                    if (files) {
                        for (var i = 0; i < files.length; i++) {
                            var fileLevel = files[i].fileLevel;
                            var fileLevelText = files[i].fileLevelText;
                            var fileSec = '<div class="fileSecLevel fileSecXg layui-input-inline">' + '<@secSelect.sec_select data_src=1 hasBlank=false/>' + "</div>";
                            var newStr = '<span class="file-id" style="margin-right: 20px;" fileId=' + files[i].fileId + ' fileLevelText="' + fileLevelText + '">' + fileSec + '<span class="file-name" title="点击下载文件" onclick="downFile(this)"><i class="iconfont" style="margin-right: 5px"></i>' + files[i].fileName + '</span></span>';
                            $(this).html(newStr);
                            $(this).find("select:last").val(fileLevel);
                            $(this).find("select:last").attr("disabled", "disabled");
                        }
                    } else {
                        $(this).html("<span style='color: #c0c4cc'>未上传</span>");
                    }
                });
                //-修改页面 初始化附件组件 结束 ------------------------------------------
            }
        });

        //下载附件
        window.downFile = function (obj) {
            var fileId = $(obj).parents("span").attr("fileId");
            window.location.href = serverPath.qbdmsPath + setter.extendLinkPath + "attachFile/download?fileId=" + fileId;
        }

        publicMethods.bottomFixd()
        $("body *").not("#closeWindow").attr("disabled", "disabled");
        $(".uploadFileCont .qbdms-fileUp,.uploadFileCont i,.addFormTr1").hide();
        $(".uploadFileCont").each(function () {
            if ($(this).children('.uploadFileList').children().length == 0) {
                $(this).children('.uploadFileList').append("<span style='color: #C0C4CC'>未上传</span>")
            }
        })

    });
</script>
</body>
</html>